package visiopuce.DAO;

import java.math.BigDecimal;
import java.util.List;

import org.hibernate.Query;

import visiopuce.HibernateUtil;
import visiopuce.objets.ExpFish;

public class ExpFishDAOImpl extends GenericDAOImpl<ExpFish, BigDecimal> implements ExpFishDAO {

	/** Constructeur priv� */
	private ExpFishDAOImpl() {
	}

	/** Instance unique non pr�initialis�e */
	private static ExpFishDAOImpl INSTANCE = null;

	/** Point d'acc�s pour l'instance unique du singleton */
	public static ExpFishDAO getInstance() {
		if (INSTANCE == null) {
			INSTANCE = new ExpFishDAOImpl();
		}
		return INSTANCE;
	}

	@Override
	public List<ExpFish> getExpFishByVerif(int idVerifFish) {
		List<ExpFish> ef = null;
		String sql = "SELECT e FROM ExpFish e WHERE e.veriffish.idVerifFish = :idVerifFish";
		Query query = HibernateUtil.getSession().createQuery(sql).setParameter("idVerifFish", idVerifFish);
		ef = findMany(query);
		return ef;
	}



}